package com.wbs.controller;

import com.wbs.model.TbItem;
import com.wbs.resutil.Result;
import com.wbs.service.ItemCatService;
import com.wbs.vo.ItemCatVo;
import com.wbs.vo.TypeTemplateVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @Author: 芝梦
 * @Description: 分类选项
 * @DateTime: 2024/1/29 19:53
 */
@RequestMapping("itemCat")
@RestController
public class ItemCatController {
    @Autowired
    private ItemCatService itemCatService;



    //通过ParentId查找
    @GetMapping("findByParentId")
    public Result findByParentId(@RequestParam Long parentId){
        List<ItemCatVo> itemCatVoList = itemCatService.findByParentId(parentId);
        return Result.SUCCESS().setData(itemCatVoList);
    }
    //通过ParentId查找
    @GetMapping("getTypetemplate")
    public Result getTypetemplate(@RequestParam Long id){
        TypeTemplateVo typeTemplateVo = itemCatService.getTypetemplate(id);
        return Result.SUCCESS().setData(typeTemplateVo);
    }


}
